﻿Public Class MyAppEnv
    Public Property MyDocs() As String
        Get
            MyDocs = My.Computer.FileSystem.SpecialDirectories.MyDocuments
        End Get
        Set(ByVal value As String)
        End Set
    End Property

    Public Function MyAppDocs() As String
        MyAppDocs = MyDocs & "\" & My.Application.Info.ProductName
        If Not IO.Directory.Exists(MyAppDocs) Then IO.Directory.CreateDirectory(MyAppDocs)
    End Function

    Public Function MyAppDocs(ByVal argDir As String) As String
        MyAppDocs = MyDocs & "\" & My.Application.Info.ProductName
        If Not IO.Directory.Exists(MyAppDocs) Then IO.Directory.CreateDirectory(MyAppDocs)
        MyAppDocs = MyAppDocs & "\" & argDir
        If Not IO.Directory.Exists(MyAppDocs) Then IO.Directory.CreateDirectory(MyAppDocs)
    End Function

    Public Property MyAppData() As String
        Get
            MyAppData = My.Computer.FileSystem.SpecialDirectories.CurrentUserApplicationData
        End Get
        Set(ByVal value As String)
        End Set
    End Property

    Public Function AppDataDir(ByVal argFolder As String) As String
        AppDataDir = MyAppData & "\" & argFolder
        If Not IO.Directory.Exists(AppDataDir) Then IO.Directory.CreateDirectory(AppDataDir)
    End Function
End Class
